---
# tasklist for setting up a git server (git:// access)

- name: install the git-daemon package
  package: name=git-daemon state=present
  tags: git/server

# If NOT using xinetd
- name: delete stock git daemon config
  file: path="/usr/lib/systemd/system/git.service" state=absent
  when: ansible_distribution_major_version|int == 7
  tags: git/server

- name: configure git daemon
  template: >
    src="git@.service.j2"
    dest="/usr/lib/systemd/system/git@.service"
    mode=0644
  when: ansible_distribution_major_version|int == 7
  tags: git/server

# If using xinetd
- name: install xinetd
  package: name=xinetd state=present
  when: ansible_distribution_major_version|int == 6
  tags: git/server

- name: install the xinetd config file
  template: >
    src="git.j2"
    dest="/etc/xinetd.d/git"
    mode=0644
  when: ansible_distribution_major_version|int == 6
  tags: git/server
  notify:
  - restart xinetd
